package com.bzchao.oauth.service.impl;

import com.bzchao.oauth.bean.DeptExample;
import com.bzchao.oauth.mapper.DeptMapper;
import com.bzchao.oauth.service.DeptService;
import com.bzchao.oauth.bean.Dept;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;


@Service
public class DeptServiceImpl implements DeptService {
    @Autowired
    private DeptMapper dao;

    @Override
    public boolean add(Dept dept) {
        dao.insert(dept);
        return true;
    }

    @Override
    public boolean update(Dept dept) {
        dao.updateByPrimaryKey(dept);
        return true;
    }

    @Override
    public Dept get(Integer id) {
        return dao.selectByPrimaryKey(id);
    }

    @Override
    public List<Dept> list() {
        return dao.selectByExample(new DeptExample());
    }

}
